<template>
	<view class="deposit">
		<!-- 头部导航 -->
		<view class="w-750 title w-bj-white" style="position: fixed; top: 0; left: 0; z-index: 999;">
			<view class="h-100 w-row-justify-between-align">
				<view class="wh-80 w-row-center" @click="routerBack()">
					<image class="wh-40" src="@/static/gane/goBack-icon.png"></image>
				</view>
				<view class="w-350 h-100 w-row-center w-wz-conts font-36">
					<text>余额宝账单明细</text>
				</view>
				<view class="wh-80 w-row-center">
				</view>
			</view>
		</view>
		<view class="bwh-120"></view>
		<!-- 头部导航结束 -->

		<view class="content-box padding-top-xs">
			<template v-if="list.length > 0">
				<view class="van-cell disflex" v-for="i in list">
					<view class="van-cell__title">
						<span class="text-sml">{{i.type_name}}</span><br />
						<span class="text-xs text-color-grey">{{i.create_time}}</span>
					</view>
					<view class="van-cell__value">
						<span class="text-default text-bold text-color-red" v-if="i.type==2">-￥{{i.money}}</span>
            <span class="text-default text-bold text-color-green" v-else>+￥{{i.money}}</span><br>
            <span class="text-xs text-color-grey">余额：{{i.after_balance ? i.after_balance:0.00}}</span>
					</view>
				</view>
			</template>
			
			<empty v-else />
		</view>
	</view>
</template>

<script>
import $H from '@/pages/common/request.js'
	import empty from "@/components/empty.vue";
	export default {
		components:{
			empty
		},
		data() {
			return {
				list: []
			}
		},
		onLoad(option) {
		},
    created() {

      this.getBanlanceBaoLog()
    },
    methods: {
      getBanlanceBaoLog() {
        $H.post('/banlance_bao_log').then((res) => {

          if (res.code == 200) {
            this.list = res.data

          }
        })
      },
    }
	}
</script>

<style scoped lang="scss">
	body {
		color: #535d76;
		background-color: #f0f3ff;
		font-size: 3.46667vw;
	}

	uni-page-body {
		background-color: transparent;
	}

	.title {
		.w-wz-conts {
			color: #323233 !important;
		}

	}

	.content-box {
		position: fixed;
		top: 12.8vw;
		height: calc(100% - 12.8vw);
		left: 0px;
		right: 0px;
		bottom: 0px;
		overflow-x: hidden;
		overflow-y: auto;
		z-index: 1;
		padding-bottom: 3.2vw;
		
		.van-cell{
			line-height: 1.6;
		}
		
		.van-cell:not(:last-child) {
			margin-bottom: 10rpx;
		}
		
		.van-cell__title{
			flex: 1;
		}
		
		.van-cell__value {
			display: block;
		}
	}
</style>